//模块
import Vue from "vue";
//插件
import VueRouter from "vue-router";

//路由组件
// import ShouYe from "../views/ShouYe.vue";
// import FenLei from "../views/FenLei.vue";
//路由组件  懒加载
const ShouYe = () => import("../views/ShouYe.vue");
const FenLei = () => import("../views/FenLei.vue");

//二级路由组件
// import One from "../views/shouYe/One.vue";
// import Two from "../views/shouYe/Two.vue";
// import Three from "../views/shouYe/Three.vue";
//二级路由组件 懒加载
const One = () => import("../views/shouYe/One.vue");
const Two = () => import("../views/shouYe/Two.vue");
const Three = () => import("../views/shouYe/Three.vue");

//使用插件
Vue.use(VueRouter);

export default new VueRouter({
    mode:"hash",
    routes:[
        {
            path:'/shouye',
            name:"shouye",
            component:ShouYe,
            children:[
                {
                    path:"/shouye/one",
                    name:"one",
                    component:One
                },
                {
                    path:"/shouye/two",
                    name:"two",
                    component:Two
                },
                {
                    path:"/shouye/three",
                    name:"three",
                    component:Three
                },
            ]
        },
        {
            path:"/fenlei",
            name:"fenlei",
            component:FenLei
        }
    ]
})